package agency.web.app.repository.impl;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import agency.web.app.domain.Tour;
import agency.web.app.repository.TourDao;
import agency.web.app.repository.base.AbstractHibernateDao;

@Repository
public class TourRepository extends AbstractHibernateDao<Tour,Integer> implements TourDao{

	public Tour findById(int tourId) {
		Criteria cr = getSession()
				.createCriteria(Tour.class, "tour")
				.add(Restrictions.eq("id", tourId));
		return (Tour) cr.uniqueResult();
	}
}
